<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>jquery源码解析视频78-2</title>
  <script src="../jquery-2.0.3.js"></script>
</head>

<body>
  <iframe src="https://www.baidu.com" frameborder="0"></iframe>

  <script>
    $(function () {
      // contents 跨iframe的操作
      console.log($("iframe").contents().body.style.background = "red");

    });
  </script>
</body>

</html>